<?php
namespace application\common\model;
use think\Model;

class SiteLink extends Model
{
	/**
	 * 首页友情链接列表
	 */
	public function getIndexList()
	{
		//缓存
		$cache = md5(__METHOD__.implode('', func_get_args()));
		if (cache($cache)) return cache($cache);
		$resObj = $this->field(['linktype', 'name', 'url', 'logo'])
					->where(['status' => 0])
					->order('listorder')
					->select();
		$resArr = collection($resObj)->toArray();
		
		cache($cache, $resArr);
		return $resArr;
	}
}